package com.java.web;

import com.java.dao.commDao;
import com.java.dao.commDaoImpl;
import com.java.doMain.commodity;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author xyd
 * @Date 2021/12/23 17:15
 * @Version 1.0
 */
public class findProductByIdServlet extends HttpServlet {

    private commDao commDao = new commDaoImpl();

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String cid = request.getParameter("cid");
        commodity commodity = commDao.selectByCid(Integer.parseInt(cid));
        request.setAttribute("message",commodity);
        request.getRequestDispatcher(request.getContextPath() + "/client/info.jsp").forward(request,response);
    }
}
